package dao.impl;


import dao.DeptDao;
import org.apache.ibatis.session.SqlSession;
import pojo.Dept;
import util.MyBatisUtil;

import java.util.List;

public class DeptDaolmpl implements DeptDao {
    public List<Dept> findAll() {
        return MyBatisUtil.getSession().getMapper(DeptDaolmpl.class).findAll();
    }

    @Override
    public int addDept(Dept dept) {
        SqlSession session = MyBatisUtil.getSession();
        int result =session.getMapper(DeptDao.class).addDept(dept);
        session.commit();
        return result;
    }
}

